<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>二手交易网</title>
    <link rel="stylesheet" href="css/myCss.css">
    <link rel="icon" href="img/school.jpg">
</head>
<body>
    <div class="nav">
        <a href="index">二手交易网</a>
        <c:if test="${empty sessionScope.user }">
            <a href="login.jsp">登陆</a>
            <a href="register.jsp">注册</a>
        </c:if>
    </div>

    <div class="memu">
        <a href="index"><div class="memuAll">所有宝贝</div></a><a href="Upload.jsp"><div class="memuNormal">上架商品</div></a><a href="goodsTradeInf"><div class="memuNormal">交易信息</div></a>
    </div>

    <div class="show">
        <div class="showimg">
            <div class="goodsImage" style="background-image: url(${tradeGoods.goodsImageAddress})"></div>
        </div>
        <div class="showInf">
            <span class="goodsTitle">${tradeGoods.goodsName}</span>
            <div id="goodsPrice">
                <span class="priceInf">价格</span>
                <span class="showprice">￥${tradeGoods.goodsValue}</span>
            </div>
            <div class="showseller">出售者:<span style="color: #3e3e3e">${tradeGoods.sellerName}</span></div>
            <div class="youself">购买者:<span style="color: #3e3e3e">${user.userName}</span></div>
            <c:if test="${empty user}">
                <button class="buy_goods" type="button" disabled>请先登陆</button>
            </c:if>
            <c:if test="${not empty user}">
                <form action="goods_GoodsBuy" method="post">
                    <input type="hidden" name="userName" value="${user.userName}">
                    <input type="hidden" name="goods.goodsId" value="${tradeGoods.goodsId}">
                    <button class="buy_goods" type="submit">购买</button>
                </form>
            </c:if>
        </div>
    </div>
</body>
</html>